<template lang="html">
  <div class="record">
    <div class="container">
      <scroll
        class="scroll"
        :data="list"
        :pullup="isPullup"
        @scrollToEnd="searchMore"
        v-if="list && list.length"
        ref="suggest"
      >
        <ul>
          <li v-for="i in list">
            <!-- <div class="date">

            </div> -->
            <div class="main">
              <div class="head">
                <div class="info">
                  <i>
                    <img class="max" src="/static/modules/transfer/team_icom_transfer@2x.png">
                  </i>
                  <span>转让记录</span>
                </div>
                <div class="date-day">
                  {{ i.add_time }}
                </div>

              </div>
              <p>
                {{ i.data }}
              </p>
            </div>
          </li>
        </ul>
      </scroll>

  <div
    class="notMore flex-display flex-display-column flex-center-align"
    v-if="!list.length"
  >
    <img src="/static/ethel_img/shopping_img_em.png">
    <span>记录空空如也！！</span>
  </div>
  </div>
  </div>
</template>

<script>
import { getTurnCloudInfo } from '@/api/transfer'
import Scroll from "@/base/scroll/scroll";
import Loading from "@/base/loading/loading";
import { Toast, MessageBox, Indicator } from "mint-ui";
export default {
  components: {
    Scroll,
    Loading,
    Toast,
    MessageBox,
    Indicator
  },
  data() {
    return {
      list: [],
      isNext: null,
    }
  },
  created() {
    this.getTurnCloudInfo()
  },
  methods: {
    getTurnCloudInfo() {
      getTurnCloudInfo({
        userid: this.getUserInfo().id,
        isNext: this.isNext ? this.isNext : ""
      }).then(res=>{
        this.list = [...this.list, ...res.data];
        this.isNext = res.next;
      })
    },
    /**
     * @desc 是否需要下拉加载
     */
    searchMore() {
      if (this.isNext) {
        this.getJifenInfo();
        return;
      }
      Toast({
        message: "我是有底线的",
        position: "middle",
        duration: 2000
      });
    },
  }
}
</script>

<style lang="scss" scoped>
.record{
  text-align: center;
  padding-bottom: 1rem;
  .date{
    display: inline-block;
    background-color: rgba(0,0,0,0.2);
    color: #fff;
    padding: .05rem .2rem;
    margin: 0 auto;
    font-size: .34rem;
    border-radius: 2px;
  }
  li{
    margin-top: .4rem;
    .main{
      background-color: #fff;
      margin: 0 .4rem;
      padding: .3rem;
      border-radius: 4px;
      text-align: left;
      margin-top: .3rem;
      .head{
        border-bottom: 1px solid #EEEEEE;
        padding-bottom: .3rem;
        margin-bottom: .3rem;
        padding-top: .05rem;
        font-weight: 600;
        overflow: hidden;
        i{
          width: .7rem;
          display: inline-block;
        }
      }
      p{
        color: #666363;
        font-size: .34rem;
        line-height: .6rem;
      }
    }
    .info{
      float: left;
    }
    .date-day{
      float: right;
      font-weight: 100;
      color: #999999;
      font-size: .34rem;
    }
  }
}

.scroll {
  height: 100%;
  overflow: hidden;
}

.container {
  position: fixed;
  width: 100%;
  top: 0;
  bottom: 0;
  background: #f0f0f0;
  border-top: 1px solid #e5e5e5;
  ul {
    width: 100%;
    height: auto;
    margin-top: .4rem;
    margin-bottom: .4rem;
    overflow: hidden;
    li.item {
      width: 100%;
      min-height: 70px;
      background: #fff;
      img {
        width: 84px;
        height: 84px;
        display: inline-block;
        margin-left: 10px;
      }
    }
  }
  .pro-info {
    margin-left: 10px;
  }
  .item-count {
    width: 100%;
    height: 25px;
    position: relative;
    margin-top: 5px;
  }

  .hidden {
    display: none;
  }

  .item-count > span {
    font-size: 16px;
    color: rgba(255, 155, 175, 1);
  }
}
.notMore {
  width: 100%;
  height: 100%;
  padding-top: 70px;
  span {
    font-size: 13px;
    color: rgba(160, 154, 155, 1);
    margin-top: 15px;
  }
  img {
    width: 140px;
    height: 85px;
    display: block;
  }

}
</style>
